# Copyright 2017, taseer94@gmail.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

[DEFAULT]
use_journal = True
# Print more verbose output (set logging level to INFO instead of default WARNING level).

# Print debugging output (set logging level to DEBUG instead of default WARNING level).
# debug = False

# log_format = %(asctime)s %(levelname)8s [%(name)s] %(message)s
# log_date_format = %Y-%m-%d %H:%M:%S

# use_syslog                           -> syslog
# log_file and log_dir                 -> log_dir/log_file
# (not log_file) and log_dir           -> log_dir/{binary_name}.log
# use_stderr                           -> stderr
# (not user_stderr) and (not log_file) -> stdout
# publish_errors                       -> notification system

# use_syslog = False
# syslog_log_facility = LOG_USER

# use_stderr = True

# publish_errors = False

# Address to bind the API server to
bind_host = 0.0.0.0

# Port the bind the API server to
bind_port = "{{ congress_service_port }}"

# The path to the latest policy dump
policy_path = /etc/congress/snapshot

# Paste configuration file
api_paste_config = api-paste.ini

# If set to true, the logging level will be set to DEBUG instead of the default
# INFO level. (boolean value)
# Note: This option can be changed without restarting.
debug = {{ debug | bool }}


# The strategy to be used for auth.
# Supported values are 'keystone'(default), 'noauth'.
auth_strategy = noauth

# List of datasource driver class paths to import.
# For example: congress.datasources.neutronv2_driver.NeutronV2Driver, etc
# errors seen in log, removed congress.datasources.swift_driver.SwiftDriver
drivers = congress.datasources.neutronv2_driver.NeutronV2Driver,congress.datasources.glancev2_driver.GlanceV2Driver,congress.datasources.nova_driver.NovaDriver,congress.datasources.keystone_driver.KeystoneDriver,congress.datasources.cinder_driver.CinderDriver,congress.datasources.swift_driver.SwiftDriver

# oslo.messaging default transport
transport_url = {{ congress_oslomsg_rpc_transport }}://{% for host in congress_oslomsg_rpc_servers.split(',') %}{{ congress_oslomsg_rpc_userid }}:{{ congress_oslomsg_rpc_password }}@{{ host }}:{{ congress_oslomsg_rpc_port }}{% if not loop.last %},{% else %}/{{ congress_oslomsg_rpc_vhost }}{% if (congress_oslomsg_rpc_use_ssl | lower) | bool %}?ssl=1{% else %}?ssl=0{% endif %}{% endif %}{% endfor %}

[oslo_messaging_rabbit]
ssl = {{ congress_oslomsg_notify_use_ssl | bool }}

[oslo_messaging_notifications]
transport_url = {{ congress_oslomsg_notify_transport }}://{% for host in congress_oslomsg_notify_servers.split(',') %}{{ congress_oslomsg_notify_userid }}:{{ congress_oslomsg_notify_password }}@{{ host }}:{{ congress_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ congress_oslomsg_notify_vhost }}{% if (congress_oslomsg_notify_use_ssl | lower) | bool %}?ssl=1{% else %}?ssl=0{% endif %}{% endif %}{% endfor %}

[keystone_authtoken]
auth_host = "{{ keystone_admin_user_name }}"
auth_port = 5000
auth_protocol = http
admin_tenant_name = admin
admin_user = "{{ congress_service_project_name }}"
admin_password = "{{ congress_service_password }}"

[database]
connection = mysql+pymysql://{{ congress_galera_user }}:{{ congress_container_mysql_password }}@{{ congress_galera_address }}/{{ congress_galera_database }}?charset=utf8{% if congress_galera_use_ssl | bool %}&ssl_ca={{ congress_galera_ssl_ca_cert }}{% endif %}
